package linked;

/**
 * Created by lzan13 on 2024/03/14
 * 描述单向链表节点类
 */
public class LinkedNode<T> {
    // 数据
    private T data;
    // 上一个节点
    private LinkedNode<T> prev;
    // 下一个节点
    private LinkedNode<T> next;

    // 空的构造
    public LinkedNode() {
    }

    public LinkedNode(T data, LinkedNode<T> prev, LinkedNode<T> next) {
        this.data = data;
        this.prev = prev;
        this.next = next;
    }

    public void setData(T data) {
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setPrev(LinkedNode<T> prev) {
        this.prev = prev;
    }

    public LinkedNode<T> getPrev() {
        return prev;
    }

    public void setNext(LinkedNode<T> next) {
        this.next = next;
    }

    public LinkedNode<T> getNext() {
        return next;
    }

}
